from time import sleep

from selenium.webdriver.common.by import By

from base import Base
class Base():
    def __init__(self):
        cap = {
            "platformName": "Android",
            "deviceName": "emulator-5554 ",
            "appPackage": "com.kongfz",
            "appActivity": "com.kongfz.activity.home.HomeActivity",
            "noReset": True
        }

    sousuokuang = (By.ID,'com.kongfz.app:id/11_search')

    shurukuang = (By.XPATH,'/hierarchy/android.widget.Framelayout/android.widget.linearLayout')

    sousuoanniu = "new UiSelector().txt('搜索')"

    sousuoanniu2 = "new UiSeletor().resourceld('com.kongfz.app:id/ll_scan')"

    dy = (By.XPATH,'//ayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.')


    def sousuoyewu(self,content):

        self.find_ele(self.sousuokuang).click()
        sleep(2)

        self.find_ele(self.sousuokuang).send_keys(content)
        sleep(2)

        self.find_ele(self.sousuoanniu).click()
        sleep(3)

